/**
 * @desc
 *
 * @使用场景
 *
 * @author  杨晓东[of1081]
 * @company qianmi.com
 * @Date    16/4/6
 **/
'use strict';

import  * as path from 'path';

/**
 * 从组件的路径中提取组件的name
 *
 * eg:
 * ./store-ui/img-comp ==> ImgComp
 * ./widget-group/test-group ==>TestGroup
 *
 * @param path
 * @returns {string}
 */
export function  extraWidgetNameFromPath(widgetPath){
    var paths = widgetPath.split('/');
    var names = paths[paths.length - 1].split('-');

    var CompontentName = names.map(function(partName) {
        return partName.substring(0, 1).toUpperCase() + partName.substring(1, partName.length);
    }).join('');
    return CompontentName;

}